function fileJYFY() {
  let formTag = '#kzqd_jyfy_xz_wj', fileTag = formTag + " input[name='up_files']"; let files = $(fileTag)[0].files;

  if (files.length == 0) { window.top.$.messager.alert('提示', '请选择要上传的文件！', 'info'); return; } let index = $("#kzqd_jyfy_xz").attr("data-i");

  var size = 0; for (var i = 0; i < files.length; ++i) size += files[i].size; if (size / (1024 * 1024) > 1) { window.top.$.messager.alert('提示', '上传文件大小不能超过1M！', 'info'); return; }

  var formData = new FormData($(formTag)[0]); formData.append("view", "用户管理"); formData.append("code", "wzwh"); upload("/page/set", formData, function (ret) { console.log(JSON.parse(ret.data)[0]); });
}

function upload(addr, param, func0, func2) {
  $.ajax({
    type: 'post',
    url: addr,
    processData: false, //必须false才会避开jQuery对formdata的默认处理,XMLHttpRequest会对formdata进行正确的处理
    contentType: false, //必须false才会自动加上正确的Content-Type
    data: param,
    beforeSend: function (req) { window.top.$.messager.progress({ msg: "上传中，请稍候！" }); },
    success: function (ret) {
      if (1 == ret.code) {
        if (parent == self) {
          if (!(window.location.pathname == "/" || window.location.pathname == '/index.html')) window.location.href = "/index.html";
        }
        else parent.location.href = "/index.html";
      }
      if (2 == ret.code) { window.top.$.messager.alert('错误', ret.data, 'error'); if (typeof (func2) == 'function') func2(); }
      if (3 == ret.code) { window.top.$.messager.show({ title: '提示', msg: ret.data, showType: 'show', style: { right: '', bottom: '' } }); if (typeof (func0) == 'function') func0(ret); }
      if (0 == ret.code) { if (typeof (func0) == 'function') func0(ret); }
    },
    complete: function (ret) { window.top.$.messager.progress('close'); },
    error: function (err) { console.log(err); window.top.$.messager.alert('错误', '访问错误，请刷新网页！', 'error'); }
  });


  
}